#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
#define rep(i, a, b) for (int i = (a); i <= (b); i++)
#define per(i, a, b) for (int i = (a); i >= (b); i--)
#define endl '\n'
const int N = 1005;

int n, m;
int vis[N], primes[N], tot;
void init(int n) {
  vis[1] = 1;
  rep(i, 2, n) {
    if (!vis[i]) primes[++tot] = i;
    rep(j, 1, tot) {
      ll k = 1ll * primes[j] * i;
      if (k > n) break;
      vis[k] = 1;
      if (i % primes[j] == 0) break;
    }
  }
}
int a[N];
int cnt[N], sum;
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  init(1e3);
  cin >> n;
  rep(i, 1, n) cin >> a[i];
  int ans1 = 1, ans2 = 0;
  rep(i, 1, tot) {
    sum = 0;
    int p = primes[i];
    rep(j, 1, n) {
      cnt[j] = 0;
      while (a[j] % p == 0) a[j] /= p, cnt[j]++;
      sum += cnt[j];
    }
    int avg = sum / n;
    if (avg) {
      rep(j, 1, avg) ans1 *= p;
      rep(j, 1, n) if (cnt[j] < avg) ans2 += avg - cnt[j];
    }
  }
  int mn = *min_element(a + 1, a + n + 1), mx = *max_element(a + 1, a + n + 1);
  if (mn == mx) ans1 *= mn;
  cout << ans1 << ' ' << ans2;
  return 0;
}
